package org.zhadoop.streaming.config;

import java.io.Serializable;
import org.apache.commons.lang.StringUtils;

/**
 * 数据流schema 中的信息：属性数据类型：属性名称
 * @author zwd
 *
 */
public class Attribute implements Serializable{

	/**
	 * 
	 */
	private static final long serialVersionUID = 3171428048864403570L;
	
	/**
	 * 属性数据类型
	 */
	private Class<?> attDataType;
	
	/**
	 * 属性名称
	 */
	private String attName;
	
	public Attribute(Class<?> dt, String name) {
		if(StringUtils.isEmpty(name)){
			throw new RuntimeException("The attribute name is empty");
		}
		if(null == dt){
			throw new RuntimeException("The Class of attribute is null. attribute name=" + name);
		}
		this.attDataType = dt;
		this.attName = name;
	}

	public Class<?> getAttDataType() {
		return attDataType;
	}

	public void setAttDataType(Class<?> attDataType) {
		this.attDataType = attDataType;
	}

	public String getAttName() {
		return attName;
	}

	public void setAttName(String attName) {
		this.attName = attName;
	}
}
